﻿/**
 * @name umi 的路由配置
 * @description 只支持 path,component,routes,redirect,wrappers,name,icon 的配置
 * @param path  path 只支持两种占位符配置，第一种是动态参数 :id 的形式，第二种是 * 通配符，通配符只能出现路由字符串的最后。
 * @param component 配置 location 和 path 匹配后用于渲染的 React 组件路径。可以是绝对路径，也可以是相对路径，如果是相对路径，会从 src/pages 开始找起。
 * @param routes 配置子路由，通常在需要为多个路径增加 layout 组件时使用。
 * @param redirect 配置路由跳转
 * @param wrappers 配置路由组件的包装组件，通过包装组件可以为当前的路由组件组合进更多的功能。 比如，可以用于路由级别的权限校验
 * @param name 配置路由的标题，默认读取国际化文件 menu.ts 中 menu.xxxx 的值，如配置 name 为 login，则读取 menu.ts 中 menu.login 的取值作为标题
 * @param icon 配置路由的图标，取值参考 https://ant.design/components/icon-cn， 注意去除风格后缀和大小写，如想要配置图标为 <StepBackwardOutlined /> 则取值应为 stepBackward 或 StepBackward，如想要配置图标为 <UserOutlined /> 则取值应为 user 或者 User
 * @doc https://umijs.org/docs/guides/routes
 */
export default [
  {
    path: '/user',
    layout: false,
    routes: [
      {
        path: '/user/login',
        layout: false,
        name: 'login',
        component: './user/login',
      },
      {
        path: '/user',
        redirect: '/user/login',
      },
      {
        name: 'register-result',
        icon: 'smile',
        path: '/user/register-result',
        component: './user/register-result',
      },
      {
        name: 'register',
        icon: 'smile',
        path: '/user/register',
        component: './user/register',
      },
    ],
  },
  {
    path: '/dashboard/analysis',
    name: 'dashboard',
    icon: 'dashboard',
    component: './dashboard/analysis',
  },
  {
    name: 'person',
    icon: 'TeamOutlined',
    path: '/person',
    access: 'normalRouteFilter',
    routes: [
      {
        path: '/person',
        redirect: '/person/organization',
      },
      {
        name: 'organization',
        icon: 'smile',
        path: '/person/organization',
        component: './person/organization',
        access: 'normalRouteFilter',
      },
      {
        name: 'employee',
        icon: 'smile',
        path: '/person/employee',
        component: './person/employee',
        access: 'normalRouteFilter',
      },
      {
        name: 'position',
        icon: 'smile',
        path: '/person/position',
        component: './person/position',
        access: 'normalRouteFilter',
      },
      {
        name: 'stranger',
        icon: 'smile',
        path: '/person/stranger',
        component: './person/stranger',
        access: 'normalRouteFilter',
      },
      {
        name: 'biometric',
        icon: 'smile',
        path: '/person/biometric',
        component: './person/biometric',
      },
      {
        name: 'dictionary',
        icon: 'smile',
        path: '/person/dictionary',
        component: './person/dictionary',
      },
    ],
  },
  {
    name: 'access',
    icon: 'UnlockOutlined',
    path: '/access',
    access: 'normalRouteFilter',
    routes: [
      {
        path: '/access',
        redirect: '/access/door',
        access: 'normalRouteFilter',
      },
      {
        name: 'door',
        icon: 'smile',
        path: '/access/door',
        component: './access/door',
        access: 'normalRouteFilter',
      },
      {
        name: 'device',
        icon: 'smile',
        path: '/access/device',
        component: './access/device',
        access: 'normalRouteFilter',
      },
      {
        name: 'passage',
        icon: 'smile',
        path: '/access/passage',
        component: './access/passage',
        access: 'normalRouteFilter',
      },
      {
        name: 'period',
        icon: 'smile',
        path: '/access/period',
        component: './access/period',
        access: 'normalRouteFilter',
      },
      {
        name: 'monitoring',
        icon: 'smile',
        path: '/access/monitoring',
        component: './access/monitoring',
        access: 'normalRouteFilter',
      },
      {
        name: 'area',
        icon: 'smile',
        path: '/access/area',
        component: './access/area',
        access: 'normalRouteFilter',
      },
      {
        name: 'highsecurity',
        icon: 'smile',
        path: '/access/highsecurity',
        component: './access/highsecurity',
        access: 'normalRouteFilter',
      },
      {
        name: 'records',
        icon: 'smile',
        path: '/access/records',
        component: './access/records',
        access: 'normalRouteFilter',
      },
      {
        name: 'exceptionrecords',
        icon: 'smile',
        path: '/access/exceptionrecords',
        component: './access/exceptionrecords',
        access: 'normalRouteFilter',
      },
      {
        name: 'electmap',
        icon: 'smile',
        path: '/access/electmap',
        component: './access/electmap',
        access: 'normalRouteFilter',
      },
    ],
  },
  {
    name: 'attend',
    icon: 'FieldTimeOutlined',
    path: '/attend',
    access: 'normalRouteFilter',
    routes: [
      {
        path: '/attend',
        redirect: '/attend/group',
      },
      {
        name: 'group',
        icon: 'smile',
        path: '/attend/group',
        component: './attend/group',
      },
      {
        name: 'point',
        icon: 'smile',
        path: '/attend/point',
        component: './attend/point',
      },
      {
        name: 'rule',
        icon: 'smile',
        path: '/attend/rule',
        component: './attend/rule',
      },
      {
        name: 'scheduling',
        icon: 'smile',
        path: '/attend/scheduling',
        component: './attend/scheduling',
      },
      {
        name: 'details',
        icon: 'smile',
        path: '/attend/details',
        component: './attend/details',
      },
      {
        name: 'compilation',
        icon: 'smile',
        path: '/attend/compilation',
        routes: [
          {
            name: 'user',
            icon: 'smile',
            path: '/attend/compilation/user',
            component: './attend/compilation/user',
          },
          {
            name: 'department',
            icon: 'smile',
            path: '/attend/compilation/department',
            component: './attend/compilation/department',
          },
          {
            name: 'role',
            icon: 'smile',
            path: '/attend/compilation/role',
            component: './attend/compilation/role',
          },
        ],
      },
    ],
  },
  {
    name: 'pos',
    icon: 'DollarOutlined',
    path: '/pos',
    access: 'normalRouteFilter',
    routes: [
      {
        path: '/pos',
        redirect: '/pos/accounttype',
      },
      {
        name: 'accounttype',
        icon: 'smile',
        path: '/pos/accounttype',
        component: './pos/accounttype',
        access: 'normalRouteFilter',
      },
      {
        name: 'mealtype',
        icon: 'smile',
        path: '/pos/mealtype',
        component: './pos/mealtype',
        access: 'normalRouteFilter',
      },
      {
        name: 'restaurant',
        icon: 'smile',
        path: '/pos/restaurant',
        component: './pos/restaurant',
        access: 'normalRouteFilter',
      },
      {
        name: 'account',
        icon: 'smile',
        path: '/pos/account',
        component: './pos/account',
        access: 'normalRouteFilter',
      },
      {
        name: 'device',
        icon: 'smile',
        path: '/pos/device',
        component: './pos/device',
        access: 'normalRouteFilter',
      },
      {
        name: 'details',
        icon: 'smile',
        path: '/pos/details',
        access: 'normalRouteFilter',
        routes: [
          {
            name: 'recharge',
            icon: 'smile',
            path: '/pos/details/recharge',
            component: './pos/details/recharge',
            access: 'normalRouteFilter',
          },
          {
            name: 'consum',
            icon: 'smile',
            path: '/pos/details/consum',
            component: './pos/details/consum',
            access: 'normalRouteFilter',
          },
          {
            name: 'refund',
            icon: 'smile',
            path: '/pos/details/refund',
            component: './pos/details/refund',
            access: 'normalRouteFilter',
          },
          {
            name: 'transaction',
            icon: 'smile',
            path: '/pos/details/transaction',
            component: './pos/details/transaction',
            access: 'normalRouteFilter',
          },
        ],
      },
      {
        name: 'compilation',
        icon: 'smile',
        path: '/pos/compilation',
        access: 'normalRouteFilter',
        routes: [
          {
            name: 'cardtype',
            icon: 'smile',
            path: '/pos/compilation/cardtype',
            component: './pos/compilation/cardtype',
            access: 'normalRouteFilter',
          },
          {
            name: 'department',
            icon: 'smile',
            path: '/pos/compilation/department',
            component: './pos/compilation/department',
            access: 'normalRouteFilter',
          },
          {
            name: 'role',
            icon: 'smile',
            path: '/pos/compilation/role',
            component: './pos/compilation/role',
            access: 'normalRouteFilter',
          },
          {
            name: 'restaurant',
            icon: 'smile',
            path: '/pos/compilation/restaurant',
            component: './pos/compilation/restaurant',
            access: 'normalRouteFilter',
          },
          {
            name: 'period',
            icon: 'smile',
            path: '/pos/compilation/period',
            component: './pos/compilation/period',
            access: 'normalRouteFilter',
          },
        ],
      },
    ],
  },
  {
    name: 'system',
    icon: 'SettingOutlined',
    path: '/system',
    access: 'normalRouteFilter',
    routes: [
      {
        path: '/system',
        redirect: '/system/role',
      },
      {
        name: 'role',
        icon: 'smile',
        path: '/system/role',
        component: './system/role',
        access: 'normalRouteFilter',
      },
      {
        name: 'user',
        icon: 'smile',
        path: '/system/user',
        component: './system/user',
        access: 'normalRouteFilter',
      },
      {
        name: 'settings',
        icon: 'smile',
        path: '/system/account/settings',
        component: './system/account/settings',
      },
    ],
  },
  {
    path: '/',
    redirect: '/dashboard/analysis',
  },
];
